<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
/**
 * @var Mage_Page_Block_Html_Header $this
 */
?>
<?php
$ttl = 0;
$wbid = Mage::app()->getStore()->getId();
if(apc_fetch("topcacheTTL_{$wbid}")) $ttl=1;
$wbid = Mage::app()->getWebsite()->getId();

if($ttl)
{
    $topmenu = apc_fetch("topmenu_{$wbid}");
    $homebanner = apc_fetch("homebanner_{$wbid}");
}
else
{
    $topmenu = $this->getChildHtml('topMenu');
    $homebanner = $this->getChildHtml('homebanner');

    apc_add("topmenu_{$wbid}", $topmenu);
    apc_add("homebanner_{$wbid}", $homebanner);
    apc_add("topcacheTTL_{$wbid}",1,3600);
}
$rca = Mage::app()->getRequest()->getRouteName().Mage::app()->getRequest()->getControllerName().Mage::app()->getRequest()->getActionName();
?>
<div class="header-container">
    <div class="header-toplinks">
    <p class="welcome-msg"><?php echo $this->getChildHtml('welcome') ?> <?php echo $this->getAdditionalHtml() ?></p>
    <?php echo $this->getChildHtml('topLinks') ?>
    </div>
    <div class="header">
        <?php if ($this->getIsHomePage()):?>
        <h1 class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a></h1>
        <?php else:?>
        <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><strong><?php echo $this->getLogoAlt() ?></strong><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /></a>
        <?php endif?>
        <?php echo $this->getChildHtml('topSearch') ?>

        <div class="block-cart">
            <div class="download"><i class="fa fa-mobile left-icon"></i>下载手机客户端<i class="fa fa-angle-right"></i></div>
            <div class="QrCode" style="display:none" ><img src="<?php echo $this->getSkinUrl('images/anzhuo.jpg') ?>" alt="" /></div>
        </div>

        <?php echo $this->getChildHtml('header_cart_sidebar') ?>

        <?php echo $this->getChildHtml('topContainer'); ?>
    </div>
    <?php echo $this->getChildHtml('topMenu') ?>
    <?php //if($rca == 'cmsindexindex') echo $topmenu;?>
</div>
<div class="banner-wraper">
<?php echo $this->getChildHtml('homebanner') ?>
<?php //if($rca == 'cmsindexindex') echo $homebanner; ?>
</div>
<script type="text/javascript">
    (function($){
        $(".banner-wraper").height($('.sub-category').height());
        $(function(){
            $(window).resize(function(){
                if($('.banner-wraper .flexslider').size()>0)
                    $(".banner-wraper").height("auto");
            })
        })
    })(jQuery)
</script>


